#pragma once
#include<stdlib.h>
#include<math.h>
int n, m, p, q, min = INT_MAX;

int next[4][2] = { {0,1},{1,0},{0,-1},{-1,0} };
int maze[51][51], book[51][51];

void dfs(int x, int y, int step);